﻿using System;

namespace DepSoft.Mobile.WP7.FollwIt.Messages
{
    public abstract class BaseMessage
    {
        #region Private members
        /// <summary>
        /// Exception
        /// </summary>
        private Exception _exception;
        #endregion

        #region Public properties
        /// <summary>
        /// Gets or sets the exception
        /// </summary>
        public Exception Exception
        {
            get
            {
                return this._exception;
            }

            internal set
            {
                this._exception = value;
            }
        }

        /// <summary>
        /// Request failed
        /// </summary>
        public bool Failed
        {
            get
            {
                return this._exception != null;
            }
        }
        #endregion

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMessage"/> class.
        /// </summary>
        public BaseMessage()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMessage"/> class.
        /// </summary>
        /// <param name="ex">
        /// The ex.
        /// </param>
        public BaseMessage(Exception ex)
        {
            this._exception = ex;
        }
        #endregion
    }
}
